package com.brainshare.an.service.impl;

import java.util.List;
import com.brainshare.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainshare.an.mapper.CampLogMapper;
import com.brainshare.an.domain.CampLog;
import com.brainshare.an.service.ICampLogService;

/**
 * 训练营日志Service业务层处理
 * 
 * @author wolong
 * @date 2023-04-04
 */
@Service
public class CampLogServiceImpl implements ICampLogService 
{
    @Autowired
    private CampLogMapper campLogMapper;

    /**
     * 查询训练营日志
     * 
     * @param id 训练营日志主键
     * @return 训练营日志
     */
    @Override
    public CampLog selectCampLogById(Long id)
    {
        return campLogMapper.selectCampLogById(id);
    }

    /**
     * 查询训练营日志列表
     * 
     * @param campLog 训练营日志
     * @return 训练营日志
     */
    @Override
    public List<CampLog> selectCampLogList(CampLog campLog)
    {
        return campLogMapper.selectCampLogList(campLog);
    }

    /**
     * 新增训练营日志
     * 
     * @param campLog 训练营日志
     * @return 结果
     */
    @Override
    public int insertCampLog(CampLog campLog)
    {
        campLog.setCreateTime(DateUtils.getNowDate());
        return campLogMapper.insertCampLog(campLog);
    }

    /**
     * 修改训练营日志
     * 
     * @param campLog 训练营日志
     * @return 结果
     */
    @Override
    public int updateCampLog(CampLog campLog)
    {
        return campLogMapper.updateCampLog(campLog);
    }

    /**
     * 批量删除训练营日志
     * 
     * @param ids 需要删除的训练营日志主键
     * @return 结果
     */
    @Override
    public int deleteCampLogByIds(Long[] ids)
    {
        return campLogMapper.deleteCampLogByIds(ids);
    }

    /**
     * 删除训练营日志信息
     * 
     * @param id 训练营日志主键
     * @return 结果
     */
    @Override
    public int deleteCampLogById(Long id)
    {
        return campLogMapper.deleteCampLogById(id);
    }
}
